// 封装一个储存token的模块
const TokenName = 'shang-2020-12-27'

// 1 设置token
export function setToken (tokenObj) {
  localStorage.setItem(TokenName, JSON.stringify(tokenObj))
}

// 2 获取token
export function getToken () {
  return JSON.parse(localStorage.getItem(TokenName)) || {}
}

// 删除token
export function removeToken () {
  localStorage.removeItem(TokenName)
}
